import { Component, OnInit } from '@angular/core';
import {Observable} from "rxjs/Observable";
import {Http, Headers} from "@angular/http";
import 'rxjs/Rx';

@Component({
  selector: 'app-product2',
  templateUrl: './product2.component.html',
  styleUrls: ['./product2.component.css']
})
export class Product2Component implements OnInit {

  products:Observable<any>;

  constructor(private http:Http) {
    let myHeaders:Headers = new Headers();
    myHeaders.append("Authorization","Basic 123456");

    this.products = this.http.get('/api/products',{herders: myHeaders}).map((res) => res.json());
  }

  ngOnInit() {
  }

}
